# Contributor: Eivind Uggedal <eu@eju.no>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-jwt
pkgver=2.9.0
pkgrel=0
pkgdesc="Python3 JSON Web Token implementation"
url="https://github.com/jpadilla/pyjwt"
license="MIT"
arch="noarch"
makedepends="py3-gpep517 py3-installer py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/jpadilla/pyjwt/archive/$pkgver/py3-jwt-$pkgver.tar.gz"
builddir="$srcdir/pyjwt-$pkgver"

replaces="py-jwt" # Backwards compatibility
provides="py-jwt=$pkgver-r$pkgrel" # Backwards compatibility

# secfixes:
#   2.4.0-r0:
#     - CVE-2022-29217

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/PyJWT-$pkgver-py3-none-any.whl
}

sha512sums="
c49dd32e76321c3354c50849e50a8b3f3f91f370bdfe60ea7a3c97f0426b5fa813aba4d223a5b18213b45d6372e966a58b7aa5a16e294d480173e73eda7b3ff9  py3-jwt-2.9.0.tar.gz
"
